﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

using nr.Tombola;

namespace nr.Tombola.NetGame
{
    public class Server
    {
        /// <summary>
        /// Comunica l'avvio del gioco.
        /// </summary>
        public event ServerMessageEventHandler GameStart;

        /// <summary>
        /// Comunica la fine del gioco.
        /// </summary>
        public event ServerMessageEventHandler GameFinish;

        /// <summary>
        /// Comunica l'estrazione di un nuovo numero.
        /// </summary>
        public event ServerMessageEventHandler NumberExtract;

        /// <summary>
        /// Comunica l'invio di un comando di controllo ai client.
        /// </summary>
        public event ServerMessageEventHandler Command;
 
        /// <summary>
        /// Aggiunge un client alla partita.
        /// </summary>
        /// <param name="client">Client da aggiungere.</param>
        private void AddClient(Client client)
        {
            this.Command += client.ServerCommand;
            this.GameFinish += client.GameFinished;
            this.GameStart += client.GameStarted;
            this.NumberExtract += client.NumberExctract;
        }


    }
}
